package variablearguments;

public class VarArg {
    public static void main(String[] args) {
        test1();
        test2("abc");
        test3("abc","def","gh");
    }

    public static void test1(){
        System.out.println("无参函数");
    }
    public static void test2(String str){
        System.out.println("有参函数"  + str);
    }

    // ... 代表参数的个数不确定
    public static void test3(String... str){
        // System.out.println(str.length);
        // System.out.println(str.getClass().getName());

        for (String s : str) {
            System.out.println(s);
        }
    }
}
